#define __ChuShuiDuanDian_c

#include "includeAll.h"

void CSDDFunction()
{
    // static uint16_t checkTime=0;
// static uint8_t checkNum=0;
// static bit lastCSDD=0;
// static uint16_t holdsetTimer=0;
// static uint16_t holdtClrimer=0;
    // if((P_CSDD==1)&&(lastP_CSDD==0))
    // {
    // startCheck=1;
    // }
    // if((lastP_CSDD!=P_CSDD)&&(startCheck))
    // {
    // checkTime=0;
    // checkNum++;
    // if(checkNum>)
    // }
    // lastP_CSDD=P_CSDD;
    // if(startCheck)
    // {
    // checkTime++;
    // }



    if((checkTime>0)&&(bDuanDian==0))
    {
        checkTime--;
        if(checkTime==0)
        {
            checkNum=0;
        }
    }
    if(lastCSDD!=P_CSDD)
    {
        if(bDuanDian==0)
        {
            if(checkTime==0)
            {
                checkTime=750;
            }
            checkNum++;
            if(checkNum>18)
            {
                checkNum=0;
                checkTime=0;
                bDuanDian=1;
            }
        }
    }

    if(bDuanDian)
    {
        checkTime++;

        if(lastCSDD!=P_CSDD)
        {
            if(bShouDongBeng==0)
            {
                if(checkTime>8)//原来为200
                {
                    holdtClrimer=0;
                    holdsetTimer++;
                    if(holdsetTimer>10)
                    {
                        setBengJDQ;
                        holdsetTimer=0;
                    }
                    //  setBengJDQ;
                    //	 shouDongTime=10;
                    //	 bShouDongBeng=1;
                }
                if(checkTime<3)//80
                {
                    // clrBengJDQ;
                    holdsetTimer=0;
                    holdtClrimer++;
                    if(holdtClrimer>10)
                    {
                        clrBengJDQ;
                        holdtClrimer=0;
                    }
                }
            }
            checkTime=0;
        }
        if(checkTime>250)
        {
            checkTime=0;
          
            bDuanDian=0;
			if(bShouDongBeng==0)
			{
				clrBengJDQ;
			}
			// clrBengJDQ;
            //bShouDongBeng=0;
        }
    }



    lastCSDD=P_CSDD;
}



